In drug delivery devices such as insulin pumps, occlusion detection is desirable as a safety feature. Occlusions may typically be detected by measuring parameters in a pump chamber or by a flow sensor.